home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- CLASS: MiscUser
- INHERITS FROM: Object
- CONFORMS TO: None
- PROGRAMMER: Todd Thomas, Copyright 1994, 1995.
- DESIGN ADVICE: Don Yacktman
- DATE BEGAN: December 17, 1994
- LAST CHANGED: January 23, 1995
- VERSION: 0.3
- CHANGES: See end of implementation file.
-
- An instance of MiscUser represents a single user on a system. Once you
- initialize an instance via either uid or username (login name), you can
- then ask the object for information about the user, such as real name,
- shell, home directory, primary group, and a list of groups he/she is
- a member of. You can also ask the class object for a list of all users
- on the system.
-
- If you are on a system with multiple domains (say local and network)
- there is a possiblility of users belonging to both domains. When
- asking the system for a list of all users, all domains are traversed
- and duplicates entries removed. Oh, and as always, if anyone has any
- ideas on additions/changes to these objects, please let me know.
-
- This object is included in the MiscKit by permission from the author
- and its use is governed by the MiscKit license, found in the file
- "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- for a list of all applicable permissions and restrictions.
-
- *****************************************************************************/
-
- #include <objc/Object.h>
-
- @class MiscUserGroup;
- @class List;
-
-
- @interface MiscUser : Object
- {
- int uid;
- int gid;
- char *username;
- char *realname;
- char *shell;
- char *homeDirectory;
- }
-
- + (BOOL)filterSystemUsers;
- + setFilterSystemUsers: (BOOL)filter;
-
- + (List *)allUsers;
- + (MiscUser *)whoAmI;
-
- - initWithUserId: (int)userId;
- - initWithUsername: (const char *)uname;
- - free;
-
- - (const char *)username;
- - (const char *)realname;
- - (int)userId;
-
- - (MiscUserGroup *)primaryGroup;
- - (List *)groups;
- - (const char *)shell;
- - (const char *)homeDirectory;
-
- @end
-